<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ page import="com.pignest.hotel.spring.Services" %><%@ page import="com.pignest.hotel.system.*" %><%@ page import="com.pignest.framework.util.Utils" %><%
String contextPath = request.getContextPath();
String url = Services.getAdminService().getDutyUrl(request);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>值班记录</title>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/hotel.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/log.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/flexigrid.css"/>
<script type="text/javascript" src="<%=contextPath%>/scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/flexigrid.js"></script>
<script type="text/javascript">
function reset(){
	$('form input:text').val('');
	$('form select').val('-1');
}
</script>
</head>

<body>
<div id="wrapper" class="gtable">
  <div style="margin-top: 0px;" id="caption">
    <div class="bg">
      <h1>值班记录</h1>
    </div>
  </div>
        <div id="content-wrapper">
            <div id="content">
                <div class="content">
                    <div id="tabs1" style="display: block;">
<form action="duty.jsp" method="get">
	<table cellspacing="0" cellpadding="0">
		<tr class="odd">
			<td  width="100px" align="right">用户名</td>
			<td>
				<input type="text" value="${param.userName}" name="userName" style="width:120px" maxlength="82"/>
			</td>
			<td  width="100px" align="right">状态</td>
			<td>
				<select name="status" style="width:120px;">
					<option value="-1">-所有状态-</option>
					<option value="0">正在值班</option>
					<option value="1">暂停</option>
					<option value="2">结束</option>
				</select>
			</td>
			<td align="center"><input type="button" value="重置" onclick="javascript:reset();" style="padding:3px;width:120px;"/></td>
			<td align="center"><input type="submit" value="查询" style="padding:3px;width:120px;"/></td>
		</tr>
	</table>
</form>
                    </div>
                    <div id="tabs2" style="display: block;">
                    		<table id="dutyTable" style="display:none"></table>
				</div>
			</div>
		</div>
	</div>
	<div id="footer">
		<jsp:include page="/modules/global/inc/footer.jsp"></jsp:include>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
	var tableHeight = $(document).height()-$("#tabs2").offset().top - 74;
	$("#dutyTable").flexigrid({
		url: '<%=url%>',
		dataType: 'json',
		colModel : [
			{display: '用户名', name : 'user.name', width : 90, sortable : false, align: 'center'},
			{display: '状态', name : 'status', width : 71, sortable : false, align: 'center'},
			{display: '开始时间', name : 'startTime', width : 130, sortable : false, align: 'center'},
			{display: '结束时间', name : 'endTime', width : 130, sortable : false, align: 'center'},
			{display: '交接人', name : 'previouseUser.name', width : 90, sortable : false, align: 'center'},
			{display: '开始金额', name : 'startAmount', width : 85, sortable : false, align: 'center'},
			{display: '结束金额', name : 'endAmount', width : 90, sortable : false, align: 'center'},
			{display: '财务提取', name : 'withdraw', width : 90, sortable : false, align: 'center'}
			],
		usepager: true,
		useRp: false,
		rp: 15,
		showTableToggleBtn: false,
		showToggleBtn: false,
		minheight: 30,
		resizable:false,
		pagestat: '第 {from} - {to} 条记录, 共 {total} 条',
		pagetext: '第',
		outof: '页, 共',
		totalpage: ' 页',
		nomsg: '没有找到相关记录',
		procmsg: '正在请求, 请稍等; 如果长时间没有反应, 请刷新',
		errormsg: '连接错误',
		height: tableHeight
	});
	$("form select").val(${param.status});
});
</script>
</body>
</html>
